from flask import Flask
from flask_cors import CORS
from model import db
from views.goods_bp import goods_bp


def create_app(config):
    app = Flask(__name__)

    app.config.from_object(config)

    CORS(app)

    app.register_blueprint(goods_bp)

    db.init_app(app)

    return app